package com.rapida.pet.core;

import android.view.View;

import com.rapida.framwork.IBOutlet;
import com.rapida.framwork.IVOutlet;
import com.rapida.framwork.UIViewController;

/**
 * Created by mm on 2015/5/12.
 */

@IVOutlet(id=R.layout.activity_main)
public class MainUI extends UIViewController implements View.OnClickListener {
    @IBOutlet(id=R.id.screen_main_pet1)
    private View Pet1;
    @IBOutlet(id=R.id.screen_main_pet2)
    private View Pet2;
    @IBOutlet(id=R.id.screen_main_pet3)
    private View Pet3;
    @IBOutlet(id=R.id.screen_main_pet4)
    private View Pet4;
    @IBOutlet(id=R.id.screen_main_pet5)
    private View Pet5;

    @Override
    protected void viewDidLoad() {
        Pet1.setOnClickListener(this);
        Pet2.setOnClickListener(this);
        Pet3.setOnClickListener(this);
        Pet4.setOnClickListener(this);
        Pet5.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.screen_main_pet1:
                emit("trigerEvent", PetBehavie.Event.E1);
                break;
            case R.id.screen_main_pet2:
                emit("trigerEvent", PetBehavie.Event.E2);
                break;
            case R.id.screen_main_pet3:
                emit("trigerEvent", PetBehavie.Event.E3);
                break;
            case R.id.screen_main_pet4:
                emit("trigerEvent", PetBehavie.Event.E4);
                break;
            case R.id.screen_main_pet5:
                emit("trigerEvent", PetBehavie.Event.E5);
                break;
        }
    }
}
